import Vue from 'vue'
import VueRouter from 'vue-router'
Vue.use(VueRouter)
const routes = [
  {
    name: 'home',
    path: '/',
    redirect: '/artlist/0',
    component: () => {
      return import('../views/home/Home.vue')
    },
    children: [
      {
        name: 'sonPage',
        path: 'artlist/:id',
        component: () => {
          return import('../views/articleList/ArticleList.vue')
        }
      }
    ]
  },
  {
    name: 'login',
    path: '/login',
    component: () => {
      return import('../views/login/Login.vue')
    }
  },
  {
    name: 'registry',
    path: '/registry',
    component: () => {
      return import('../views/login/Registry.vue')
    }
  },
  {
    name: 'article',
    path: '/artcontent/:id',
    component: () => {
      return import('../views/articleContent/ArticleContent.vue')
    }
  },
  {
    name: 'searchPage',
    path: '/searchlist/:key',
    component: () => {
      return import('../views/searchMomentList/SearchMomentList.vue')
    }
  }
]

const router = new VueRouter({
  routes
})

export default router
